module game
{
	/**蝌蚪类 */
	export class Tadpole extends egret.DisplayObjectContainer
	{
		private head:egret.Sprite;
		private name_txt:egret.TextField;
		private lv_txt:egret.TextField;

		public constructor()
		{
			super();
			this.init();
		}

		/**初始化 */
		private init():void
		{
			this.head = new egret.Sprite();
			this.head.graphics.beginFill(0);
			this.head.graphics.drawEllipse(0,0,40,50);
			this.head.graphics.lineStyle(8,0);
			this.head.graphics.moveTo(20,25);
			this.head.graphics.lineTo(20,75);
			this.head.graphics.endFill();
			this.addChild(this.head);
			this.head.anchorOffsetX = this.head.width/2;
			this.head.anchorOffsetY = this.head.height/2;
			this.head.y = 60 + this.head.height/2;
			this.head.x = 20;

			this.name_txt = new egret.TextField();
			this.name_txt.text = "name..";
			this.name_txt.width = 100;
			this.name_txt.textAlign = "center";

			this.lv_txt = new egret.TextField();
			this.lv_txt.width = 100;
			this.lv_txt.textAlign = "center";
			this.lv_txt.text = "lv......";

			this.addChild(this.name_txt);
			this.name_txt.y = 30;
			this.name_txt.x = -25;
			this.addChild(this.lv_txt);
			this.lv_txt.x = -25;

			this.anchorOffsetX = this.head.anchorOffsetX + this.head.x;
			this.anchorOffsetY = this.head.anchorOffsetY + this.head.y;
		}

		/**修改方向 */
		public set changeDir(rot:number)
		{
			this.head.rotation = rot;
		}

		public get changeDir():number
		{
			return this.head.rotation;
		}

		/**修改 */
		public changePos():void
		{

		}
	}
}